import React from 'react';
import { CopyrightCircleOutlined } from '@ant-design/icons';

import police from '@/assets/images/police.png';
import { TextAlignProperty } from 'csstype';

interface IcpFooterProps {
  textAlign?: TextAlignProperty;
  siteProfile: any;
}

const IcpFooter: React.FC<IcpFooterProps> = ({ textAlign, siteProfile }) => (
  <footer style={{ textAlign: textAlign }}>
    <span>
      Copyright <CopyrightCircleOutlined /> 2018~{new Date().getFullYear()} <a href="https://www.xuzhao.xin"><strong>xuzhao</strong></a> All Rights Reserved.
    </span>
    <span>
      <a href={siteProfile.icp_url} target="_blank" rel="noopener noreferrer">{siteProfile.icp_code}</a>
      <a
        style={{
          background: `url(${police}) no-repeat`,
          paddingLeft: '22px'
        }}
        target="_blank"
        rel="noopener noreferrer"
        href={siteProfile.police_icp_url}
      >
        {siteProfile.police_icp_code}
      </a>
    </span>
  </footer>
);

IcpFooter.displayName = 'icpFooter';

IcpFooter.defaultProps = {
  textAlign: 'center',
};

export default IcpFooter;
